mediator = require 'mediator'
MyListView = require 'views/base/custom/my_list_view'
WineListItemView = require './wines_list_item_view'

module.exports = class WinesListView extends MyListView
	
	tagName: 'ul' 
	className: 'wines-list'
	id: 'wines-list'
	#autoRender: true
	clickedItemInternalEventName:'wines-list:clickedItem'
		
	@selectedItemEventName:'wines-list:CurrentSelected'

	getSelectedItemEventName:->
		WinesListView.selectedItemEventName

	getView: (item) ->
		console.debug 'WinesListView#getView'
		view=new WineListItemView 
			model: item
		super view

	render: ->
		super
		@renderAllItems()
		$(@containerSelector).html(@$el)

	afterRender:->
		super
